local ty_1v2_xc = fk.CreateSkill {
    name = "ty_1v2_xc&",
    anim_type = "offensive",
    tags = { Skill.Compulsory },
    dynamic_desc = function(self, player)
        return "ty_1v2_xc_ewai&:" .. 1 + player:getMark("@xuchangdmage")
    end,
}

Fk:loadTranslationTable {
    ["ty_1v2_xc&"] = "许昌",
    [":ty_1v2_xc&"] = "锁定技，体力值不大于你的其他角色非锁定技失效；结束阶段，你有50％概率受到1点雷电伤害，若未触发，下次触发时受到的伤害+1。",

    [":ty_1v2_xc_ewai&"] = "锁定技，体力值不大于你的其他角色非锁定技失效；结束阶段，你有50％概率受到{1}点雷电伤害，若未触发，下次触发时受到的伤害+1。",

    ["@xuchangdmage"] = "额外伤害+",
}
ty_1v2_xc:addEffect("invalidity", {
    invalidity_func = function(self, from, skill)
        for _, id in ipairs(Fk:currentRoom().alive_players) do
            if id.role == "lord" then
                return from.hp < id.hp and not skill:hasTag(Skill.Compulsory, false) and skill:isPlayerSkill(from)
            end
        end
    end
})
ty_1v2_xc:addEffect(fk.EventPhaseStart, {
    anim_type = "defensive",
    mute = true,
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(ty_1v2_xc.name)
            and player.phase == Player.Finish
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local n = 1 + player:getMark("@xuchangdmage")
        if math.random() < 0.5 then
            room:notifySkillInvoked(player, ty_1v2_xc.name)
            room:damage {
                to = player,
                damage = n,
                damageType = fk.ThunderDamage,
                skillName = ty_1v2_xc.name,
            }
            room:setPlayerMark(player, "@xuchangdmage", 0)
        else
            room:addPlayerMark(player, "@xuchangdmage")
        end
    end,
})
return ty_1v2_xc
